package xrc.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import xrc.pojo.User;
import xrc.rabbitmq.MQSender;
import xrc.vo.RespBean;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author xrc
 * @since 2023-07-15
 */
@Controller
@RequestMapping("/user")
public class UserController {

    /*@Autowired
    private MQSender mqSender;

    // 用户信息（测试）
    @RequestMapping("/info")
    @ResponseBody
    public RespBean info(User user) {
        return RespBean.success(user);
    }

    // 测试发送RabbitMQ消息
    @RequestMapping("/mq")
    @ResponseBody
    public void mq() {
        mqSender.send("hello jay");
    }

    // fanout模式
    @RequestMapping("/mq/fanoutExchange")
    @ResponseBody
    public void mq02() {
        mqSender.send("hello david");
    }

    // Direct模式
    @RequestMapping("/mq/direct01")
    @ResponseBody
    public void mq03() {
        mqSender.send01("Hello red");
    }

    @RequestMapping("/mq/direct02")
    @ResponseBody
    public void mq04() {
        mqSender.send02("Hello green");
    }

    // topic模式
    @RequestMapping("/mq/topic01")
    @ResponseBody
    public void mq05() {
        mqSender.send03("Hello bag");
    }

    @RequestMapping("/mq/topic02")
    @ResponseBody
    public void mq06() {
        mqSender.send04("Hello small bag");
    }*/

}
